package com.iplant.aps.service;

import com.iplant.aps.service.mesenum.BPMEventModule;
import com.iplant.aps.service.po.ServiceResult;
import com.iplant.aps.service.po.aps.APSTaskStep;
import com.iplant.aps.service.po.bms.BMSEmployee;
import com.iplant.aps.service.po.bpm.BPMTaskBase;
import com.iplant.aps.service.po.cfg.CFGItem;
import com.iplant.aps.service.po.excel.ExcelData;
import com.iplant.aps.service.po.fpc.FPCPart;
import com.iplant.aps.service.po.fpc.FPCPartPoint;
import com.iplant.aps.service.po.fpc.FPCRoutePartPoint;
import com.iplant.aps.service.po.ipt.IPTPreCheckProblem;
import com.iplant.aps.service.po.mss.MSSBOMItem;
import com.iplant.aps.service.po.oms.OMSOrder;
import com.iplant.aps.service.po.sfc.*;

import java.util.Calendar;
import java.util.List;
import java.util.Map;

public interface SFCService {
    ServiceResult<SFCTaskStep> SFC_QueryTaskStep(BMSEmployee paramBMSEmployee, int paramInt);

    ServiceResult<List<SFCTaskStep>> SFC_QueryTaskStepList(BMSEmployee paramBMSEmployee, int paramInt1, int paramInt2,
                                                           int paramInt3, int paramInt4, int paramInt5);

    ServiceResult<Integer> SFC_UpdateTaskStep(BMSEmployee paramBMSEmployee, SFCTaskStep paramSFCTaskStep);

    ServiceResult<List<BMSEmployee>> SFC_QueryDispatchEmployeeList(BMSEmployee paramBMSEmployee, boolean paramBoolean,
                                                                   List<Integer> paramList);

    ServiceResult<List<SFCTaskStep>> SFC_QueryTaskStepListByEmployeeID(BMSEmployee paramBMSEmployee,
                                                                       Calendar wStartTime, Calendar wEndTime,
                                                                       int wTagTypes);

    ServiceResult<List<SFCTaskStep>> SFC_QueryTaskStepListByMonitorID(BMSEmployee paramBMSEmployee,
                                                                      Calendar paramCalendar);

    ServiceResult<Integer> SFC_AdjustHour(BMSEmployee paramBMSEmployee, List<SFCTaskStep> paramList,
                                          Double paramDouble);

    ServiceResult<Map<Integer, List<Integer>>> SFC_QueryStepPersonMap(BMSEmployee paramBMSEmployee,
                                                                      List<APSTaskStep> paramList);

    ServiceResult<List<BMSEmployee>> SFC_QueryPGEmployeeList(BMSEmployee paramBMSEmployee, int paramInt);

    // ServiceResult<Integer> SFC_TaskStepSubmitAll(BMSEmployee paramBMSEmployee, List<APSTaskStep> paramList);

    ServiceResult<Integer> SFC_TaskStepSaveAll(BMSEmployee paramBMSEmployee, List<APSTaskStep> paramList);

    ServiceResult<Integer> SFC_SubmitPGProblems(BMSEmployee paramBMSEmployee, List<IPTPreCheckProblem> paramList);

    ServiceResult<SFCOrderForm> SFC_QueryOrderForm(BMSEmployee paramBMSEmployee, int paramInt);

    ServiceResult<List<SFCOrderForm>> SFC_QueryCompleteConfirmList(BMSEmployee paramBMSEmployee);

    ServiceResult<Integer> SFC_CompleteConfirm(BMSEmployee paramBMSEmployee, int paramInt, List<String> paramList,
                                               String paramString);

    ServiceResult<SFCOrderForm> SFC_QueryOrderForm(BMSEmployee paramBMSEmployee, int paramInt1, int paramInt2);

    ServiceResult<List<SFCTaskStep>> SFC_QueryTaskStepList(BMSEmployee paramBMSEmployee, List<Integer> paramList);

    ServiceResult<Integer> SFC_DeleteList(BMSEmployee wLoginUser, List<SFCTaskStep> wList);

    /**
     * 查询偶换件不合格评审任务历史记录
     */
    ServiceResult<List<SFCBOMTask>> SFC_QueryBOMTaskHistory(BMSEmployee wLoginUser, int wID, String wCode,
                                                            int wUpFlowID, int wFollowerID, int wOrderID, int wPartID
            , int wPartPointID, int wBOMID, int wLevel,
                                                            Calendar wStartTime, Calendar wEndTime);

    /**
     * 查询偶换件不合格评审任务
     */
    ServiceResult<List<BPMTaskBase>> SFC_QueryBOMTaskEmployeeAll(BMSEmployee wLoginUser, int wTagTypes,
                                                                 Calendar wStartTime, Calendar wEndTime);

    /**
     * 提交偶换件不合格评审任务
     */
    ServiceResult<SFCBOMTask> SFC_SubmitBOMTask(BMSEmployee wLoginUser, SFCBOMTask wTask);

    /**
     * 查询默认的状态为0的且发起人是自己的任务
     */
    ServiceResult<SFCBOMTask> SFC_QueryDefaultBOMTask(BMSEmployee wLoginUser, int value);

    /**
     * 创建默认的偶换件不合格评审任务
     */
    ServiceResult<SFCBOMTask> SFC_CreateBOMTask(BMSEmployee wLoginUser, BPMEventModule wEventID);

    /**
     * 查单条偶换件不合格评审任务
     */
    ServiceResult<SFCBOMTask> SFC_GetBOMTask(BMSEmployee wLoginUser, int wID);

    /**
     * 根据工位ID获取工位人员
     */
    ServiceResult<SFCStationPerson> SFC_QueryStationPerson(BMSEmployee wLoginUser, int wStationID);

    /**
     * 下达状态可添加派工人员
     */
    ServiceResult<Integer> SFC_AddPerson(BMSEmployee wLoginUser, APSTaskStep wData, List<Integer> wPersonIDList);

    /**
     * 查询默认状态的单据
     */
    ServiceResult<SFCAttemptRun> SFC_QueryDefaultAttemptRun(BMSEmployee wLoginUser, int wEventID);

    /**
     * 创建单据
     */
    ServiceResult<SFCAttemptRun> SFC_CreateAttemptRun(BMSEmployee wLoginUser, BPMEventModule wEventID);

    /**
     * 提交单据
     */
    ServiceResult<SFCAttemptRun> SFC_SubmitAttemptRun(BMSEmployee wLoginUser, SFCAttemptRun wData);

    /**
     * 查询单条单据
     */
    ServiceResult<SFCAttemptRun> SFC_GetAttemptRun(BMSEmployee wLoginUser, int wID);

    /**
     * 用人员拿任务
     */
    ServiceResult<List<BPMTaskBase>> SFC_QueryAttemptRunEmployeeAll(BMSEmployee wLoginUser, int wTagTypes,
                                                                    Calendar wStartTime, Calendar wEndTime);

    /**
     * 查询单据历史
     */
    ServiceResult<List<SFCAttemptRun>> SFC_QueryAttemptRunHistory(BMSEmployee wLoginUser, int wID, String wCode,
                                                                  int wUpFlowID, int wFollowerID, int wOrderID,
                                                                  int wCheckerID, int wPartID, Calendar wStartTime,
                                                                  Calendar wEndTime);

    /**
     * 判断所有的返修项是否均以完成或同意试运
     */
    ServiceResult<Boolean> SFC_JugdeItem(BMSEmployee wLoginUser, int wOrderID, int wSFCAttemptRunID);

    /**
     * 判断返修项是否全部完成
     */
    ServiceResult<Map<Integer, Integer>> SFC_JudgeAll(BMSEmployee wLoginUser, SFCAttemptRun wData);

    /**
     * 根据订单判断是否已发起试运申请单
     */
    ServiceResult<Boolean> SFC_JudgeIsSendApply(BMSEmployee wLoginUser, SFCAttemptRun wSFCAttemptRun);

/*
	/**
	 * 批量提交派工数据(优化版)
	 * /
	ServiceResult<Integer> SFC_TaskStepSubmitAllNew(BMSEmployee wLoginUser, List<APSTaskStep> wAPSTaskStepList);
*/

    /**
     * 获取机车电子履历(优化版)
     */
    ServiceResult<List<SFCSequentialInfo>> SFC_QuerySequentialInfoNew(BMSEmployee wLoginUser, int wOrderID,
                                                                      String wUUID);

    /**
     * 删除重复的派工记录
     */
    ServiceResult<Integer> SFC_DeleteRepeat(BMSEmployee wLoginUser);

    ServiceResult<List<SFCBOMTask>> SFC_QueryBOMTaskEmployeeAllNew(BMSEmployee wLoginUser, Calendar wStartTime,
                                                                   Calendar wEndTime, int wOrderID, int wPartID,
                                                                   int wLevel, int wStatus);

    ServiceResult<List<SFCBOMTask>> SFC_QueryBOMTaskList(BMSEmployee wLoginUser, int wOrderID, int wPartID, int wLevel,
                                                         int wStatus, Calendar wStartTime, Calendar wEndTime,
                                                         String wMaterialNo, String wMaterialName, int wIsLGL,
                                                         int wIsQualityLoss,int wCovaType);

    ServiceResult<List<SFCAttemptRun>> SFC_QueryAttemptRunEmployeeAllNew(BMSEmployee wLoginUser, Calendar wStartTime,
                                                                         Calendar wEndTime, int wProductID,
                                                                         String wPartNo, int wStatus);

    ServiceResult<List<SFCAttemptRun>> SFC_QueryAttemptRunList(BMSEmployee wLoginUser, int wOrderID, int wLineID,
                                                               int wCustomerID, int wProductID, String wPartNo,
                                                               int wStatus, Calendar wStartTime, Calendar wEndTime);

    /**
     * 获取登陆者所在工位列表
     */
    ServiceResult<List<FPCPart>> SFC_QueryLoginStationList(BMSEmployee wLoginUser);

    ServiceResult<List<BMSEmployee>> SFC_QueryPartCheckerList(BMSEmployee wLoginUser, int wPartID);

    ServiceResult<List<BMSEmployee>> SFC_QueryTechnicianList(BMSEmployee wLoginUser);

    ServiceResult<List<CFGItem>> SFC_QueryModuleList(BMSEmployee wLoginUser);

    ServiceResult<String> SFC_ExportBOMTaskList(BMSEmployee wLoginUser, Calendar wDate);

    ServiceResult<List<SFCSequentialInfoNew>> SFC_QuerySequentialInfoNew_V2(BMSEmployee wLoginUser, int wOrderID);

    ServiceResult<String> SFC_IsOverEqua(BMSEmployee wLoginUser, SFCBOMTask wTask);

    ServiceResult<SFCBOMTask> SFC_UpdateBOMTask(BMSEmployee wLoginUser, SFCBOMTask wData);

    ServiceResult<Integer> SFC_UpdateQuota(BMSEmployee wLoginUser);

    ServiceResult<List<OMSOrder>> SFC_QueryOrderListByLogID(BMSEmployee wLoginUser, int wLogID);

    /**
     * 修改评估类型
     */
    ServiceResult<Integer> SFC_UpdateAssessType(BMSEmployee wLoginUser, List<SFCBOMTaskItem> wDataList);

    ServiceResult<List<SFCTaskStepCar>> SFC_QueryDispatchCarList(BMSEmployee wLoginUser);

    ServiceResult<List<SFCTaskStepPart>> SFC_QueryDispatchPartList(BMSEmployee wLoginUser, int wOrderID);

    /**
     * 按照车辆导出订单
     */
    ServiceResult<String> SFC_ExportBOMTaskListByOrder(BMSEmployee wLoginUser, int wOrderID);

    /**
     * 所有偶换件订单列表
     */
    ServiceResult<List<OMSOrder>> SFC_QueryOrderList(BMSEmployee wLoginUser);

    /**
     * 处理重复单号问题
     */
    ServiceResult<Integer> SFC_BOMTaskCodeReset(BMSEmployee wLoginUser);

    ServiceResult<Integer> SFC_UpdateBOMTaskSubmitTime(BMSEmployee wLoginUser);

    ServiceResult<Integer> SFC_OutsourcingProcess(BMSEmployee wLoginUser, int wSFCBomTaskID, String wItemIDs);

    ServiceResult<Integer> SFC_TaskStepSubmitAllNew_v3(BMSEmployee wLoginUser, List<APSTaskStep> wAPSTaskStepList);

    ServiceResult<String> SFC_ExportBOMTaskListByTimeSlot(BMSEmployee wLoginUser, Calendar wStartTime,
                                                          Calendar wEndTime);

    ServiceResult<SFCBatchBOMItem> SFC_QueryBatchBOMItem(BMSEmployee wLoginUser, int wID);

    ServiceResult<List<SFCBatchBOMItem>> SFC_QueryBatchBOMItemList(BMSEmployee wLoginUser, int wProductID,
                                                                   int wLineID, int wPartID, int wPartPointID,
                                                                   int wReplaceType, int wOutSourceType, int wActive,
                                                                   String wMaterial,
                                                                   Calendar wStartTime,
                                                                   Calendar wEndTime);

    ServiceResult<Integer> SFC_UpdateBatchBOMItem(BMSEmployee wLoginUser, SFCBatchBOMItem wSFCBatchBOMItem);

    ServiceResult<Integer> SFC_ActiveBatchBOMItemList(BMSEmployee wLoginUser, List<SFCBatchBOMItem> wList, int wActive);

    ServiceResult<Integer> SFC_UpdateBatchBOMItemRate(BMSEmployee wLoginUser, SFCBatchBOMItem wSFCBatchBOMItem);

    ServiceResult<Integer> SFC_UpdateBatchBOMItemMinFQTY(BMSEmployee wLoginUser, SFCBatchBOMItem wSFCBatchBOMItem);

    ServiceResult<List<MSSBOMItem>> SFC_QueryEvenBOMItemList(BMSEmployee wLoginUser, int wProductID, int wLineID,
                                                             int wPartID, int wPartPointID, String wMaterial);

    /**
     * 查询默认状态的单据
     */
    ServiceResult<SFCBatchBOMTaskBPM> SFC_QueryDefaultBatchBOMTaskBPM(BMSEmployee wLoginUser, int wEventID);

    /**
     * 创建单据
     */
    ServiceResult<SFCBatchBOMTaskBPM> SFC_CreateBatchBOMTaskBPM(BMSEmployee wLoginUser, BPMEventModule wEventID);

    /**
     * 提交单据
     */
    ServiceResult<SFCBatchBOMTaskBPM> SFC_SubmitBatchBOMTaskBPM(BMSEmployee wLoginUser, SFCBatchBOMTaskBPM wData);

    /**
     * 查询单条单据
     */
    ServiceResult<SFCBatchBOMTaskBPM> SFC_GetBatchBOMTaskBPM(BMSEmployee wLoginUser, int wID);

    /**
     * 用人员拿任务
     */
    ServiceResult<List<BPMTaskBase>> SFC_QueryBatchBOMTaskBPMEmployeeAll(BMSEmployee wLoginUser, int wTagTypes,
                                                                         Calendar wStartTime, Calendar wEndTime);

    /**
     * 查询单据历史
     */
    ServiceResult<List<SFCBatchBOMTaskBPM>> SFC_QueryBatchBOMTaskBPMHistory(BMSEmployee wLoginUser, String wCode,
                                                                            int wUpFlowID, int wStatus,
                                                                            Calendar wStartTime, Calendar wEndTime);

    ServiceResult<List<SFCBatchBOMTaskBPM>> SFC_QueryBatchBOMTaskEmployeeAllWeb(BMSEmployee wLoginUser, int wPartID,
                                                                                int wPartPointID, String wMaterial,
                                                                                int wStatus, Calendar wStartTime,
                                                                                Calendar wEndTime);

    ServiceResult<List<FPCPart>> SFC_QueryBatchBOMTaskPartList(BMSEmployee wLoginUser, int wProductID, int wLineID);

    ServiceResult<List<FPCPartPoint>> SFC_QueryBatchBOMTaskPartPointList(BMSEmployee wLoginUser, int wProductID,
                                                                         int wLineID, int wPartID);

    ServiceResult<List<SFCBatchBOMTaskBPM>> SFC_QueryBatchBOMTaskEmployeeAllNew(BMSEmployee wLoginUser,
                                                                                Calendar wStartTime,
                                                                                Calendar wEndTime, int wStatus);

    String SFC_JudgeIsRepeatSend(BMSEmployee wLoginUser, SFCBOMTask wTask);

    ServiceResult<List<SFCOutMaterialConfig>> SFC_QueryOutMaterialConfigList(BMSEmployee wLoginUser, int wID,
                                                                             int wProductID, int wLineID,
                                                                             int wSuplierID, int wIsPartCode,
                                                                             int wActive, String wMaterial,
                                                                             int wPartID, int wOrderID);

    ServiceResult<Integer> SFC_UpdateOutMaterialConfig(BMSEmployee wLoginUser,
                                                       SFCOutMaterialConfig wSFCOutMaterialConfig);

    ServiceResult<Integer> SFC_ActiveOutMaterialConfigList(BMSEmployee wLoginUser, List<SFCOutMaterialConfig> wList,
                                                           int wActive);

    ServiceResult<List<MSSBOMItem>> SFC_QueryOutBOMItemList(BMSEmployee wLoginUser, int wProductID, int wLineID,
                                                            int wPartID, int wPartPointID, String wMaterial);

    ServiceResult<Integer> SFC_UpdateOutMaterialConfigList(BMSEmployee wLoginUser,
                                                           List<SFCOutMaterialConfig> wSFCOutMaterialConfigList);

    ServiceResult<Integer> SFc_UpdateOutMaterialConfigItem(BMSEmployee wLoginUser,
                                                           SFCOutMaterialConfigItem wSFCOutMaterialConfigItem);

    ServiceResult<List<SFCOutMaterialConfigItem>> SFC_QueryOutMaterialConfigItemList(BMSEmployee wLoginUser,
                                                                                     int wConfigID);

    ServiceResult<Integer> SFC_DeleteOutMaterialConfigItemList(BMSEmployee wLoginUser,
                                                               List<SFCOutMaterialConfigItem> wSFCOutMaterialConfigItemList);

    ServiceResult<String> SFC_ExportBatchBOMTaskItemAll(BMSEmployee wLoginUser, String wTaskIDs);

    /**
     * 查询默认状态的单据
     */
    ServiceResult<SFCQualityLossBPM> SFC_QueryDefaultQualityLossBPM(BMSEmployee wLoginUser, int wEventID);

    /**
     * 创建单据
     */
    ServiceResult<SFCQualityLossBPM> SFC_CreateQualityLossBPM(BMSEmployee wLoginUser, BPMEventModule wEventID);

    /**
     * 提交单据
     */
    ServiceResult<SFCQualityLossBPM> SFC_SubmitQualityLossBPM(BMSEmployee wLoginUser, SFCQualityLossBPM wData);

    /**
     * 查询单条单据
     */
    ServiceResult<SFCQualityLossBPM> SFC_GetQualityLossBPM(BMSEmployee wLoginUser, int wID);

    /**
     * 用人员拿任务
     */
    ServiceResult<List<BPMTaskBase>> SFC_QueryQualityLossBPMEmployeeAll(BMSEmployee wLoginUser, int wTagTypes,
                                                                        Calendar wStartTime, Calendar wEndTime);

    /**
     * 查询单据历史
     */
    ServiceResult<List<SFCQualityLossBPM>> SFC_QueryQualityLossBPMHistory(BMSEmployee wLoginUser, int wID, String wCode, int wUpFlowID,
                                                                          int wOrderID,int wPartID,int wPartPointID,
                                                                          int wSAPStatus, Calendar wStartTime, Calendar wEndTime);
    ServiceResult<List<SFCQualityLossBPM>>
     SFC_QueryQualityLossBPMListEmployeeAllWeb(BMSEmployee wLoginUser, int wOrderID, int wPartID, int wStatus, Calendar wStartTime, Calendar wEndTime, String wMaterial,
                                                                                     String wCode,int wSAPStatus);

    ServiceResult<List<SFCQualityLossBPM>> SFC_QuerySFCQualityLossBPMEmployeeAllNew(BMSEmployee wLoginUser, Calendar wStartTime, Calendar wEndTime, int wOrderID, int wPartID, int wStatus);

    ServiceResult<Integer> SFC_UpdateQualityLossBPM(BMSEmployee wLoginUser, SFCQualityLossBPM wSFCQualityLossBPM);

    ServiceResult<Integer> SFC_ReSendQualityLoss(BMSEmployee wLoginUser, int wSFCQualityLossID);

    ServiceResult<Integer> SFC_RePosting(BMSEmployee wLoginUser, int wSFCBomTaskID);

    ServiceResult<SFCScrapApprovalBPM> SFC_QueryDefaultScrapApprovalBPM(BMSEmployee wLoginUser, int value);

    ServiceResult<SFCScrapApprovalBPM> SFC_CreateScrapApprovalBPM(BMSEmployee wLoginUser, BPMEventModule wEventID);

    ServiceResult<SFCScrapApprovalBPM> SFC_SubmitScrapApprovalBPM(BMSEmployee wLoginUser, SFCScrapApprovalBPM wData);

    ServiceResult<SFCScrapApprovalBPM> SFC_GetScrapApprovalBPM(BMSEmployee wLoginUser, int wID);

    ServiceResult<List<SFCScrapApprovalBPM>> SFC_QueryScrapApprovalBPMHistory(BMSEmployee wLoginUser, int wID, String wCode, int wUpFlowID, int wFollowerID, int wOrderID, int wPartID, int wPartPointID,
                                                                              int wBOMID, int wLevel, Calendar wStartTime, Calendar wEndTime);

    ServiceResult<List<BPMTaskBase>> SFC_QueryScrapApprovalBPMEmployeeAll(BMSEmployee wLoginUser, int wTagTypes, Calendar wStartTime, Calendar wEndTime);

    ServiceResult<List<SFCScrapApprovalBPM>> SFC_QueryScrapApprovalBPMEmployeeAllNew(BMSEmployee wLoginUser, Calendar wStartTime, Calendar wEndTime, int wOrderID, int wPartID, int wLevel, int wStatus);

    ServiceResult<List<SFCScrapApprovalBPM>> SFC_QueryScrapApprovalBPMList(BMSEmployee wLoginUser, int wOrderID, int wPartID, int wLevel, int wStatus, Calendar wStartTime, Calendar wEndTime, String wMaterialNo, String wMaterialName, int wIsLGL, int wIsQualityLoss, int wCovaType);

    ServiceResult<SFCScrapApprovalBPM> SFC_UpdateScrapApprovalBPM(BMSEmployee wLoginUser, SFCScrapApprovalBPM wData);

    ServiceResult<Integer> SFC_ReSendScrapApprovalBPM(BMSEmployee wLoginUser, int wTaskID);

    ServiceResult<Integer> IPT_TriggerScrapReviewProcess(BMSEmployee wLoginUser, int wIPTOutMaterialID);

    ServiceResult<String> WMS_ExportQualityLoss(BMSEmployee wLoginUser, Calendar wStartTime, Calendar wEndTime);

    ServiceResult<Integer> SFC_ImportSFCOutMaterialConfig(BMSEmployee wLoginUser, ExcelData result);

    ServiceResult<List<FPCRoutePartPoint>> APS_QueryPartPointListByOrderAndRouteAndPart(BMSEmployee wLoginUser, int wOrderID, int wRouteID, int wPartID);
}
